package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the DOCUMENT_MASTER database table.
 * 
 */
@Entity
@Table(name="DOCUMENT_MASTER")
@NamedQuery(name="DocumentMaster.findAll", query="SELECT d FROM DocumentMaster d")
public class DocumentMaster implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="DOCUMENT_MASTER_DOCUID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DOCUMENT_MASTER_DOCUID_GENERATOR")
	@Column(name="DOCU_ID")
	private long docuId;

	@Column(name="DOCU_AUTHOR")
	private String docuAuthor;

	@Column(name="DOCU_CREATORDATE")
	private Timestamp docuCreatordate;

	@Column(name="DOCU_DATE")
	private Timestamp docuDate;

	@Column(name="DOCU_NAME")
	private String docuName;

	@Column(name="DOCU_PERSON")
	private String docuPerson;

	@Column(name="DOCU_STATE")
	private BigDecimal docuState;

	@Column(name="DOCU_UP")
	private BigDecimal docuUp;

	@Column(name="DOCU_UPDATEDATE")
	private Timestamp docuUpdatedate;

	//bi-directional many-to-one association to DocumentsApply
	@OneToMany(mappedBy="documentMaster")
	@JSONField(serialize=false)
	private List<DocumentsApply> documentsApplies;

	//bi-directional many-to-one association to DocumentData
	@ManyToOne
	@JoinColumn(name="DATA_ID")
	private DocumentData documentData;

	//bi-directional many-to-one association to DocumentReview
	@OneToMany(mappedBy="documentMaster")
	@JSONField(serialize=false)
	private List<DocumentReview> documentReviews;

	public DocumentMaster() {
	}

	public long getDocuId() {
		return this.docuId;
	}

	public void setDocuId(long docuId) {
		this.docuId = docuId;
	}

	public String getDocuAuthor() {
		return this.docuAuthor;
	}

	public void setDocuAuthor(String docuAuthor) {
		this.docuAuthor = docuAuthor;
	}

	public Timestamp getDocuCreatordate() {
		return this.docuCreatordate;
	}

	public void setDocuCreatordate(Timestamp docuCreatordate) {
		this.docuCreatordate = docuCreatordate;
	}

	public Timestamp getDocuDate() {
		return this.docuDate;
	}

	public void setDocuDate(Timestamp docuDate) {
		this.docuDate = docuDate;
	}

	public String getDocuName() {
		return this.docuName;
	}

	public void setDocuName(String docuName) {
		this.docuName = docuName;
	}

	public String getDocuPerson() {
		return this.docuPerson;
	}

	public void setDocuPerson(String docuPerson) {
		this.docuPerson = docuPerson;
	}

	public BigDecimal getDocuState() {
		return this.docuState;
	}

	public void setDocuState(BigDecimal docuState) {
		this.docuState = docuState;
	}

	public BigDecimal getDocuUp() {
		return this.docuUp;
	}

	public void setDocuUp(BigDecimal docuUp) {
		this.docuUp = docuUp;
	}

	public Timestamp getDocuUpdatedate() {
		return this.docuUpdatedate;
	}

	public void setDocuUpdatedate(Timestamp docuUpdatedate) {
		this.docuUpdatedate = docuUpdatedate;
	}

	public List<DocumentsApply> getDocumentsApplies() {
		return this.documentsApplies;
	}

	public void setDocumentsApplies(List<DocumentsApply> documentsApplies) {
		this.documentsApplies = documentsApplies;
	}

	public DocumentsApply addDocumentsApply(DocumentsApply documentsApply) {
		getDocumentsApplies().add(documentsApply);
		documentsApply.setDocumentMaster(this);

		return documentsApply;
	}

	public DocumentsApply removeDocumentsApply(DocumentsApply documentsApply) {
		getDocumentsApplies().remove(documentsApply);
		documentsApply.setDocumentMaster(null);

		return documentsApply;
	}

	public DocumentData getDocumentData() {
		return this.documentData;
	}

	public void setDocumentData(DocumentData documentData) {
		this.documentData = documentData;
	}

	public List<DocumentReview> getDocumentReviews() {
		return this.documentReviews;
	}

	public void setDocumentReviews(List<DocumentReview> documentReviews) {
		this.documentReviews = documentReviews;
	}

	public DocumentReview addDocumentReview(DocumentReview documentReview) {
		getDocumentReviews().add(documentReview);
		documentReview.setDocumentMaster(this);

		return documentReview;
	}

	public DocumentReview removeDocumentReview(DocumentReview documentReview) {
		getDocumentReviews().remove(documentReview);
		documentReview.setDocumentMaster(null);

		return documentReview;
	}

}